// Camera
float4x4 g_mWorld;
float4x4 g_mView;
float4x4 g_mProjection;

// Texture
texture g_Texture;

// Sampler
sampler g_Sampler = sampler_state
{
    Texture = g_Texture;
	AddressU = Clamp;
	AddressV = Clamp;
};


struct VertexShaderInput
{
    float4 vPosition : POSITION0;
	float3 vNormal : NORMAL0;
    float2 vTextureCoordinate : TEXCOORD0;
};


struct VertexShaderOutput
{
    float4 vPosition : POSITION0;
    float2 vTextureCoordinate : TEXCOORD0;
};

VertexShaderOutput DefaultVertexShader(VertexShaderInput _Input)
{
	// Create the output structure
    VertexShaderOutput Output;

	// Apply the camera transforms
	float4 vPosition = mul(_Input.vPosition, g_mWorld);
	vPosition = mul(vPosition, g_mView);
	Output.vPosition = mul(vPosition, g_mProjection);

    // Copy the texture coordinates
    Output.vTextureCoordinate = _Input.vTextureCoordinate;

	// Return the output structure
    return Output;
}

float4 DefaultPixelShader(VertexShaderOutput _Input) : COLOR0
{
	// Multiply the color by the texture lookup result
    return tex2D(g_Sampler, _Input.vTextureCoordinate);
}

// Render things
technique Default
{
    pass Pass1
    {
        VertexShader = compile vs_3_0 DefaultVertexShader();
        PixelShader = compile ps_3_0 DefaultPixelShader();
    }
}
